package com.hotel.inventory;

import com.alibaba.cloud.nacos.NacosDiscoveryProperties;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
@EnableDiscoveryClient
public class HotelInventoryApplication {
    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(HotelInventoryApplication.class, args);
        String userHome = context.getEnvironment().getProperty("user.home");
        System.out.println(userHome);
        NacosDiscoveryProperties props =
                context.getBean(NacosDiscoveryProperties.class);
        System.out.println("认证状态: " + props.getUsername() + "连接成功");
    }
}